const mongoose = require('mongoose');
const config = require('../config/dbconf');
mongoose.Promise = global.Promise;

var db=mongoose.connect(`mongodb://hudingyu:hudy320123!@${config.originIp}:${config.localPort}/${config.db.api}`, { useNewUrlParser: true });
// var db = mongoose.connect(`mongodb://${config.localUrl}:${config.localPort}/${config.db.api}`, { useNewUrlParser: true });

mongoose.connection.on("error", function (error) {
    console.log("database connnecting failed：" + error);
});

mongoose.connection.on("open", function () {
    console.log("projectlist database connnecting succeeded");
});